import 'package:animal/constant/color.dart';
import 'package:animal/constant/font.dart';
import 'package:animal/utils/screen_util.dart';
import 'package:flutter/material.dart';

///我的——选项item
class MineOptionItem extends StatelessWidget {
  String? image;
  String? name;
  GestureTapCallback? onTap;
  TextStyle? style;
  bool showBack;
  MineOptionItem({Key? key,this.image,this.name,this.onTap,this.showBack = true}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      child: Container(
        color: Colors.white,
        padding: EdgeInsets.only(left: ScreenUtil().L(15),),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Image.asset(image??"images/wechat.png",width: ScreenUtil().L(40),),
            Expanded(
              child: Container(
                margin: EdgeInsets.only(left: ScreenUtil().L(15),right: ScreenUtil().L(20)),
                padding: EdgeInsets.only(top: ScreenUtil().L(20),bottom: ScreenUtil().L(20),right: ScreenUtil().L(15)),
                decoration: BoxDecoration(
                    border: Border(bottom: BorderSide(width: ScreenUtil().L(1),color: KColorConstant.lineE5E5E5))
                ),
                child: Column(
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(name??"我发布的",style: style??KFontConstant.myTextStyle(size: 15)),
                        Visibility(visible:showBack,child: Image.asset("icons/icon_next.png",width: ScreenUtil().L(20),))
                      ],
                    ),
                  ],
                ),
              ),
            )
          ],
        ),
      ),
      onTap: onTap!,
    );
  }
}
